package cn.xie.sdk.openai.code.review.sdk.types.util;

import java.util.Random;

/**
 * @author: xiaoxie
 * create: 2025-05-31 15:48
 * @BelongsProject: openai-code-review
 * @BelongsPackage: cn.xie.sdk.openai.code.review.sdk.types.util
 * description: 随机数
 */
public class RandomStringUtils {
    public static String generateRandomString(int length) {
        String characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
        Random random = new Random();
        StringBuilder sb = new StringBuilder(length);
        for (int i = 0; i < length; i++) {
            sb.append(characters.charAt(random.nextInt(characters.length())));
        }
        return sb.toString();
    }
}
